//
//  WebRequest.m
//  Growth
//
//  Created by Hobo.Chen on 1/5/12.
//  Copyright 2012 MEETStudio. All rights reserved.
//

#import "WebRequest.h"


@implementation WebRequest

#pragma mark - login

+ (NSMutableURLRequest *)LoginRequestWith:(NSData *)jsonData{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/login",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

  	    
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
   	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
	return request;

}

+ (NSMutableURLRequest *)verifyTokenWith:(NSString *)accessToken platformId:( int)platformId{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/verify/token?platformId=%d&accessToken=%@",BASEURL, platformId,accessToken];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    CLog(@"request %@",request);
	return request;
    

    
}


+ (NSMutableURLRequest *)userBindingWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/user/binding",UCENTERBASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
	[request setHTTPMethod:@"POST"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    
	CLog(@"request %@", request);
    
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
   	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
	return request;
    
    
    
}

+ (NSMutableURLRequest *)registBindingNewWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/regist/binding/new",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    
	CLog(@"request %@", request);
    
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
   	[request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
	return request;

    
    
}

+(NSMutableURLRequest *)BindingExitWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/regist/binding/exist",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    
	CLog(@"request %@", request);
    
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
   	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
	return request;
    
}




+ (NSMutableURLRequest *)pushtokenModifyRequestWith:(NSData *)jsonData{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/pushtoken/modify",UCENTERBASEURL];
    NSURL *url = [NSURL URLWithString:urlString];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
                                                       timeoutInterval:kWebRequestTimeoutInterval];
    
    [request setHTTPMethod:@"POST"];
    
    
    [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
    //http data
    NSMutableData *httpData = [NSMutableData data];
    NSString *httpBodyString = [NSString stringWithFormat:@""];
    
    [httpData appendData:jsonData];
    
    [request setHTTPBody:httpData];
    
    
    
    CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    return request;   
}

#pragma mark - 时间轴
//String TLurl = "/mobile/timeline/"; //显示时间轴：用get方法，用的时候在后面加上时间轴的id，可以取得相应时间轴上的日志等内容显示全部

+ (NSMutableURLRequest *)timelineNewDiaryRequestWith:(int)userId timelineId:(int)timelineId timePoint:(long long)timePoint{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/diary/new?uid=%d&tid=%d&timePoint=%lld",BASEURL, userId,timelineId,timePoint];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    

    
    
}


+ (NSMutableURLRequest *)timelineDiaryListRequestWith:(int)userId timelineId:(int)timelineId  timePoint:(long long int)timePoint pageNo:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/diary?uid=%d&tid=%d&timePoint=%lld&pageNo=%d&pageSize=%d",BASEURL, userId,timelineId,timePoint,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}



+ (NSMutableURLRequest *)timelineContentRequestWith:(NSString *)timelineId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/%@",BASEURL, timelineId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
	
                                                       timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
	return request;
}

//时间轴动态
+ (NSMutableURLRequest *)diaryTrendRequestWith:(NSString *)url{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/news?%@",BASEURL, url];
	NSURL *URL = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
	return request;

    
    
}

//单条记录获取
+ (NSMutableURLRequest *)diaryContentRequestWith:(NSString *)diaryId userId:(int)uid{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary?did=%@&uid=%d",BASEURL, diaryId,uid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
	return request;
}


+ (NSMutableURLRequest *)diaryTLRuleRequestWith:(NSString *)duration{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/duration?timelineId=%@",BASEURL, duration];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	
	return request;
    
}

//String DRurl = "/mobile/diary/create"; //创建日志：用post方法，连接这个地址的时候，发送一个json的包，json包的数据应该包括以下字段及其值：
//"id"(int)
//"description"(String)
//"createdDate"(long)
//"modifiedBy"(int)
//"title"(String)
//"createdBy"(int,一个用户id，必须填写)
//"publicDiary"(bool)
+ (NSMutableURLRequest *)diaryCreateRequestWith:(NSData *)jsonData{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/create2",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
   
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
  
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
}

//日志记录评论
+ (NSMutableURLRequest *)diaryCommentRequestWith:(NSData *)jsonData{
	
	//NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/comment",BASEURL];
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/comment",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	
	return request;
}


//喜欢日志
+ (NSMutableURLRequest *)diaryLikeRequestWith:(NSString *)diaryinfo{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/favor%@",BASEURL, diaryinfo];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
}



+(NSMutableURLRequest *)friendsNewsRequestWith:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/friends/news?uid=%d&pageNo=%d&pageSize=%d",BASEURL, uid,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;

    
    
}

+(NSMutableURLRequest *)neighboursNewsRequestWith:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/neighbours/news?uid=%d&pageNo=%d&pageSize=%d",BASEURL, uid,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;
    
    
    
}



+ (NSMutableURLRequest *)newsRequest:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/news?uid=%d&pageNo=%d&pageSize=%d",BASEURL,uid,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;

    
}

+ (NSMutableURLRequest *)popularRequest:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/popular?pageNo=%d&pageSize=%d",BASEURL,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;

    
    
    
}


+ (NSMutableURLRequest *)diaryAlbumRequestWith:(NSString *)diaryPictures{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/album?diaryPictures=%@",BASEURL,diaryPictures];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];  
    
    CLog(@"Webrequest url %@",urlString);
    
	return request;
}

+ (NSMutableURLRequest *)albumDiaryRequestWith:(int)tid timePoint:(NSString *)timePoint isOlder:(NSString *)isOlder  pageNo:(int)pageNo pageSize:(int)pageSize{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/album/diary?tid=%d&timePoint=%@&isOlder=%@&pageNo=%d&pageSize=%d",BASEURL,tid,timePoint,isOlder,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;
    
       
}


#pragma mark -频道
//String CHurl = "/mobile/post/"; //取得频道:用get方法，用的时候后面加上频道的id（2，3，4可以用），可以获取相应频道的文章内容
+ (NSMutableURLRequest *)postListRequestWith:(NSString *)channelId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/post/%@",BASEURL, channelId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	
	return request;
}

//频道具体某篇文章
+ (NSMutableURLRequest *)postDetailRequestWith:(NSString *)channelId user:(NSString *)userId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/postView/%@/%@",BASEURL, channelId,userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
	return request;
}

//频道文章评论
+ (NSMutableURLRequest *)postCommentRequestWith:(NSData *)jsonData{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/PostComment/create",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}
//频道文章收藏
+ (NSMutableURLRequest *)postShoucangRequestWith:(NSData *)jsonData{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/favor/create",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


#pragma mark -
#pragma mark Family


+ (NSMutableURLRequest *)userFamilyMemberRequestWith:(NSString *)userId{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/members?uid=%@",BASEURL, userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;
    
    
}


//接受
+ (NSMutableURLRequest *)familyAcceptWith:(int)fid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/accept?fid=%d",BASEURL, fid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;
}

//删除，拒绝
+ (NSMutableURLRequest *)familyIgnoreWith:(int)fid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/ignore?fid=%d",BASEURL, fid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;
}



//邀请
//Object userIdObject = maps.get("uid");
//Object familyUserIdObject= maps.get("fuid");
//Object nicknameObject= maps.get("nickname");
//Object roleIdObject= maps.get("roleId");
+ (NSMutableURLRequest *)familyInviteWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/invite",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];

	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//申请
//Object userIdObject = maps.get("uid");
//Object familyUserIdObject= maps.get("fuid");
//Object nicknameObject= maps.get("nickname");
//Object roleIdObject= maps.get("roleId");
+ (NSMutableURLRequest *)familyApplyWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/apply",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
    
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

+ (NSMutableURLRequest *)familyMemberRoleRequestWith{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/role",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
    
    
}


+ (NSMutableURLRequest *)familyUnhandleRequestWith:(int)uid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/unhandle?uid=%d",BASEURL, uid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
}


+ (NSMutableURLRequest *)familyTrendsRequestWith:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/trends?uid=%d&pageNo=%d&pageSize=%d",BASEURL, uid,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;

        
}

+ (NSMutableURLRequest *)familyInfoRequestWith:(int)uid{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family?uid=%d",BASEURL, uid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;
    
    
}

+ (NSMutableURLRequest *)familyCovorModifyWith:(NSData *)jsonData{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/cover",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
    
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

    
    
    
}

#pragma mark - 手机

+ (NSMutableURLRequest *)phoneVertifySMSRequesetWith:(NSString *)phoneNum
{
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/sms/send?phone=%@",UCENTERBASEURL, phoneNum];
    
    NSString *encodedValue = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
    
	NSURL *url = [NSURL URLWithString:encodedValue];
    
    
    
    
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	return request;
}


#pragma mark -系统、用户、收藏




//String Burl = "/mobile/buddy/"; //取得好友:用get方法，用的时候后面加上用户的id，可以获取相应用户的朋友列表内容
+ (NSMutableURLRequest *)buddyListRequestWith:(NSString *)userId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/buddy/%@",BASEURL, userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//String UIDurl = "/mobile/user/"; //用户信息：用get方法，用的时候后面加上用户的id，可以获取相应用户的时间轴的id和一些基本个人信息。
+ (NSMutableURLRequest *)userInfoRequestWith:(NSString *)userId{
	NSString *urlString = [NSString stringWithFormat:@"%@/patientInfo",UCENTERBASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//String Burl = "/mobile/favor/"; //取得用户收藏:用get方法，用的时候后面加上用户的id，可以获取相应用户的收藏列表内容
+ (NSMutableURLRequest *)userShouCangRequestWith:(NSString *)userId pageNo:(int)pageNo pageSize:(int)pageSize{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/favor?uid=%@&pageNo=%d&pageSize=%d",BASEURL, userId,pageNo,pageSize];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
}

+ (NSMutableURLRequest *)userLetterRequestWith:(NSString *)userId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/inbox?uid=%@",BASEURL, userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
}

+ (NSMutableURLRequest *)userLetterDetailRequestWith:(NSString *)userId toUserId:(NSString *)toUserId{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/inbox/history?uid=%@&guid=%@",BASEURL, userId,toUserId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
}

+ (NSMutableURLRequest *)unreadLetterCountRequestWith:(NSString *)userId{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/inbox/unread/count?uid=%@",BASEURL, userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];	
	return request;

    
    
    
}


+ (NSMutableURLRequest *)WriteLetterRequestWith:(NSData *)jsonData{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/inbox/send",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

+(NSMutableURLRequest *)addFamilyMemberRequestWith:(NSData *)jsonData{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/family/add",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


+ (NSMutableURLRequest *)userTiemlineMemberRequestWith:(NSString *)userId{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/menu?uid=%@",BASEURL, userId];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

    
}

+ (NSMutableURLRequest *)timelineInfoRequestWith:(int)tid{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline?tid=%d",BASEURL, tid];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];  
	return request;

    
    
    
}
                                                     
+ (NSMutableURLRequest *)systemMessageCountRequestWith:(NSString *)userId{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/message/unread/count?uid=%@",BASEURL, userId];

    NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}

+ (NSMutableURLRequest *)systemMessageListRequestWith:(NSString *)userId  pageNo:(int)pageNo pageSize:(int)pageSize {
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/message?uid=%@&pageNo=%d&pageSize=%d&isRead=true",BASEURL, userId,pageNo,pageSize];
   
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}

+ (NSMutableURLRequest *)systemMessageHaveReadRequestWith:(int)userId{
    
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/message/read?uid=%d",BASEURL, userId];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

    
    
    
}


+ (NSMutableURLRequest *)timelineRecmmendRequestWith:(NSString *)userId pageNo:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/recommend?uid=%@&pageNo=%d&pageSize=%d",BASEURL, userId,pageNo,pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    

}

+ (NSMutableURLRequest *)payAttentionRequestWith:(int)tid userId:(int)uid{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/attention?uid=%d&tid=%d",BASEURL, uid,tid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
}

+ (NSMutableURLRequest *)attentionListRequestWith:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/attention?uid=%d&&pageNo=%d&pageSize=%d",BASEURL, uid,pageNo,pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
	
                                                       timeoutInterval:kWebRequestTimeoutInterval];
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
	return request;
    

    
}

+(NSMutableURLRequest *)getPlanOrAnniversaryRequestWith:(int)uid tid:(int)tid categeryId:(int)cid pageNo:(int)pageNo pageSize:(int)pageSize{
    
      NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/diary?uid=%d&tid=%d&category=%d&pageNo=%d&pageSize=%d",BASEURL, uid,tid,cid,pageNo,pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
                                    
                                                       timeoutInterval:kWebRequestTimeoutInterval];
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];	
	return request;
    

    
    
}


//setting

+ (NSMutableURLRequest *)userInfoModifyRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/MobileUser/UpdateProfileAction.aspx",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

    
}


+ (NSMutableURLRequest *)userGravatarModifyRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/gravatar/modify",UCENTERBASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}

+ (NSMutableURLRequest *)timelineInfoModifyRequestWith:(NSData *)jsonData{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/modify",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
  
    
}

+ (NSMutableURLRequest *)verifyPassWordRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/verify/password",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
     
}

+ (NSMutableURLRequest *)modifyPassWordRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/password/modify",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    

    
}

+(NSMutableURLRequest *)verifyNickNameRequest:(NSString *)nickName{

    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/verify/nickname?nickname=%@",UCENTERBASEURL, nickName];
    
     NSString *encodedValue = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
    
	NSURL *url = [NSURL URLWithString:encodedValue];
    
   
    
    
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
    
    
    
}

+(NSMutableURLRequest *)verifyEmailRequest:(NSString *)email{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/verify/account?account=%@",UCENTERBASEURL, email];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	return request;
    
    
    
}


+ (NSMutableURLRequest *)registRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/user/regist",UCENTERBASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];

	
	return request;

    
}


+ (NSMutableURLRequest *)imageWallRequestWith:(int)pageNo pageSize:(int)pageSize{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/open/diarylist?pageNo=%d&pageSize=%d",BASEURL,pageNo,pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;

    
}

+(NSMutableURLRequest *)openDiaryRequestWith:(int)did{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/open/diary?did=%d",BASEURL,did];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    

    
}

+(NSMutableURLRequest *)modifyUserLocalRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/local/modify",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	
	return request;
    

    
}

//主页封面
+ (NSMutableURLRequest *)timelineCoverRequestWith:(NSData *)jsonData{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/timeline/cover",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
    
	
	return request;
    
    
    
}


//权限家人
+(NSMutableURLRequest *)diaryFamily:(int)uid{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/family?tid=%d",BASEURL, uid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}

//权限家人
+(NSMutableURLRequest *)diaryFreinds:(int)uid{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/diary/friends?uid=%d",BASEURL, uid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
    
}

+ (NSMutableURLRequest *)systemDate
{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/system/date",BASEURL];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

#pragma mark -
#pragma mark Activity 大事件、饮食、疫苗

+ (NSMutableURLRequest *)getActivityRequestWith:(int)tid activityType:(NSString *)activityType pageNo:(int)pageNo pageSize:(int)pageSize {
    
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/activity?tid=%d&activityType=%@&pageNo=%d&pageSize=%d",BASEURL, tid,activityType,pageNo,pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

    
    
    
}


+(NSMutableURLRequest *)createActivityRequestWith:(NSData *)jsonData;{
	
	NSString *urlString = [NSString stringWithFormat:@"%@/mobile/activity/create",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	//NSString *httpBodyString = [NSString stringWithFormat:@"zip=%@&data=%@&skey=%@",zipbool,type,skey];
	
	//[httpData appendData:[httpBodyString dataUsingEncoding:NSUTF8StringEncoding]];
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];    
	return request;
}

+ (NSMutableURLRequest *)activityCheckRequestWith:(int)aid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/activity/check?aid=%d",BASEURL, aid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


#pragma mark -
#pragma mark Invite Friend
//获取好友列表
+ (NSMutableURLRequest *)allFriendsWith:(int)uid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/friends?uid=%d",BASEURL, uid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//接受好友邀请
+ (NSMutableURLRequest *)acceptFriendInvite:(int)fid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/friend/accept?fid=%d",BASEURL, fid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//忽略好友邀请
+ (NSMutableURLRequest *)gnoreFriendInvite:(int)fid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/friend/ignore?fid=%d",BASEURL, fid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//用户搜索：uid,keyWord,pageNo,pageSize
+ (NSMutableURLRequest *)userSearchWith:(int)uid keyWord:(NSString *)keyWord pageNo:(int)pageNo pageSize:(int)pageSize
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/search?uid=%d&appId=%d&keyword=%@&pageNo=%d&pageSize=%d",UCENTERBASEURL, uid, APP_ID, keyWord, pageNo, pageSize];
    
    NSString *encodedValue = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
    
	NSURL *url = [NSURL URLWithString:encodedValue];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//邀请好友：uid,fuid
+ (NSMutableURLRequest *)inviteFriendWith:(int)uid fuid:(int)fuid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/friend/invite?uid=%d&fuid=%d",BASEURL, uid, fuid];
	NSString *encodedValue = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 
    
	NSURL *url = [NSURL URLWithString:encodedValue];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//好友推荐：uid
+ (NSMutableURLRequest *)recommendFriendsWith:(int)uid pageNo:(int)pageNo pageSize:(int)pageSize
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/recommend?uid=%d&appId=%d&pageNo=%d&pageSize=%d",UCENTERBASEURL, uid, APP_ID, pageNo, pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


#pragma mark -
#pragma mark Personal View
//用户与用户关系判断(1 家人, 2 好友, 3等待家人同意, 4等待好友同意, 5陌生人) 
+ (NSMutableURLRequest *)userRelationWith:(int)uid guid:(int)guid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/relation?uid=%d&guid=%d",BASEURL, uid, guid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

//用户宝宝日志
+ (NSMutableURLRequest *)userDiariesWith:(int)uid guid:(int)guid pageNo:(int)pageNo pageSize:(int)pageSize
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/diary?uid=%d&guid=%d&pageNo=%d&pageSize=%d",BASEURL, uid,guid, pageNo, pageSize];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];	return request;
}

//用户信息
+ (NSMutableURLRequest *)userInfoWith:(int)uid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/info?uid=%d",BASEURL, uid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}



#pragma mark - 
#pragma mark album upload
/**
 * 上传图片
 */

//Object userIdObject = maps.get("uid");
//Object timelineIdObject = maps.get("tid");
//Object photoDataObject = maps.get("photoData");
//Object photoNameObject = maps.get("photoName");
//Object photoDateObject = maps.get("photoDate"); 
+ (NSMutableURLRequest *)albumUploadWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/album/upload",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

/**
 * 添加修改备注、设置月度封面、年度封面
 */
//Object albumIdObject = maps.get("aid");
//Object memoObject = maps.get("memo");
//Object monthlyCoverObject = maps.get("monthlyCover");
//Object timelineCoverObject = maps.get("timelineCover");
+ (NSMutableURLRequest *)albumPhotoModifyWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/album/photo/modify",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
    
    
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

/**
 * 相册列表
 */
+ (NSMutableURLRequest *)albumListWith:(int)tid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/album?tid=%d",BASEURL, tid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;

}

/**
 * 相册月度列表
 */
+ (NSMutableURLRequest *)albumMonthListWith:(int)tid photoMonth:(int)photoMonth photoYear:(int)photoYear
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/album/month?tid=%d&photoYear=%d&photoMonth=%d",BASEURL, tid, photoYear, photoMonth];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}

#pragma mark - Setting 设置
+ (NSMutableURLRequest *)settingsRequtestWith:(int)uid
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/alert/setting?uid=%d",BASEURL, uid];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	
    return request;
}

+ (NSMutableURLRequest *)settingModifyRequestWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/alert/setting/modify",BASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


//uid, password
+ (NSMutableURLRequest *)passwordModifyRequestWith:(NSData *)jsonData
{
    NSString *urlString = [NSString stringWithFormat:@"%@/mobile/user/password/modify",UCENTERBASEURL];
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
	[request setHTTPMethod:@"POST"];
    
	
	[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	//http data
	NSMutableData *httpData = [NSMutableData data];
	NSString *httpBodyString = [NSString stringWithFormat:@""];
	
	[httpData appendData:jsonData];
	
	[request setHTTPBody:httpData];
	
	CLog(@"http body: %@ \n %@",httpBodyString,[[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding] );
	
    
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
}


#pragma mark 版本更新
+ (NSMutableURLRequest *)versionUpdateWith:(NSString *)osType version:(NSString *)version{
    
    NSString *urlString = [NSString stringWithFormat:@"%@/openmobile/version/update?os=%@&version=%@",BASEURL,osType,version];
    
	NSURL *url = [NSURL URLWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData 
													   timeoutInterval:kWebRequestTimeoutInterval];
	
    
    NSString *UserCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-Code"];
    NSString *UserVerifyCode = [[NSUserDefaults standardUserDefaults] valueForKey:@"Ucenter-VerifyCode"];
    
    
    [request setValue:UserCode forHTTPHeaderField:@"Ucenter-Code"];
    [request setValue:UserVerifyCode forHTTPHeaderField:@"Ucenter-VerifyCode"];
    [request setValue:UCENTER_AUTHORIZATION forHTTPHeaderField:@"Ucenter-Authorization"];
	return request;
    
}



@end
